import Request from '@/utils/requset.js'
let request = new Request().http

function removeStr(obj) {
  if(obj) {
    let removePropertyOfNull=function(obj){
      Object.keys(obj).forEach(item=>{
        if(!obj[item])  delete obj[item]
      })
      return obj;
    }
    removePropertyOfNull(obj)
  }
  return obj?obj:''
}


// 通过可用状态查询视频列表
const getQueryVideo = (params) => {
	return request({
	    url: "/nailVideo/queryVideo",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 根据经纬度查询范围内终端
const getGpsInfo = (params) => {
	return request({
	    url: "/nailTerminal/querylist",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 根据终端ID查询终端信息
const getNailTerminal = (params) => {
	return request({
	    url: "/nailTerminal/queryById",
	    method: "GET",
	    params: removeStr(params),
	})
}

export {
	getQueryVideo,
	getGpsInfo,
	getNailTerminal
}